/* 
 * 
 * Created on 14 Oct 2011 by simonk
 * 
 * Copyright: Multicom Products Ltd. 2011 Bristol, England
 */
package gui.filetree;

import java.io.File;

import javax.swing.tree.DefaultMutableTreeNode;

/**
 *
 * @author simonk
 */
public class TreeNode extends DefaultMutableTreeNode {
	private static final long serialVersionUID = 1L;
	public TreeNodeInfo tnInfo = null;
	
	public TreeNode(Object o)
	{
		super(o);
		this.tnInfo = new TreeNodeInfo("Home", "", "", true);
	}
	
	public TreeNode(String name)
	{
		super(name);
		this.tnInfo = new TreeNodeInfo(name);
	}
	
	public TreeNode(File file)
	{
		super(file.getName());
		this.tnInfo = new TreeNodeInfo(file);
	}
	
	
	public TreeNode(TreeNodeInfo tni)
	{
		super(tni.name);
		this.tnInfo = tni;
	}
	
	public TreeNode(Object o, TreeNodeInfo tni)
	{
		super(o);
		this.tnInfo = tni;
	}
	
	public boolean isDirectory() {
		return tnInfo.isDirectory;
	}
}
